import fetch from 'utils/fetch';

export function getAll() {
  return fetch({
    url: '/api/supplier/businessSupplier/all',
    method: 'get'
  });
}

export function getOne(id) {
  return fetch({
    url: '/api/supplier/businessSupplier/get/' + id,
    method: 'get'
  });
}

export function addOne(supplier) {
  return fetch({
    url: '/api/supplier/businessSupplier/add',
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: JSON.stringify(supplier)
  });
}

export function findByName(supplier) {
  return fetch({
    url: '/api/supplier/businessSupplier/findByName/',
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data: JSON.stringify(supplier)
  });
}
export function updateOne(id, supplier) {
  return fetch({
    url: '/api/supplier/businessSupplier/update/' + id,
    method: 'put',
    headers: { 'Content-Type': 'application/json' },
    data: JSON.stringify(supplier)
  });
}
export function deleteOne(id) {
  return fetch({
    url: '/api/supplier/businessSupplier/delete/' + id,
    method: 'delete'
  });
}
